<?php
/*
 * Created on 01.02.2006
 *
 */

class conf_viewHandler
{

    function startElement (& $sender, $attrs, $line)
    {
        $parent = $sender->topParent();
        if ($parent['type'] != 'action')
            die("view tag must be child of action tag, defaultAction tag, " .
                    "defaultErrorAction tag or viewMapping tag in line $line.\n");
        if (empty($attrs['mapping']))
            die("Attribute mapping missing in tag view in line $line\n"); 
        if (empty($attrs['forward']))
            die("Attribute forward missing in tag action in line $line\n"); 
        $sender->appendCode('$viewmapping['.$parent['mapping'].']['
            .$attrs['mapping'].'] = '.$attrs['forward'].";\n");
    }
    
    function endElement (& $sender)
    {
    }

} 

?>